package cn.sciento.transfer.infra.data.check.constant;

import java.util.Arrays;

public enum SerializeType {
  DATA((byte)0),
  INDEX((byte)1);
  
  private byte type;
  
  SerializeType(byte type) {
    this.type = type;
  }
  
  public byte getType() {
    return this.type;
  }

  public static SerializeType valueOf(byte b) {
    return Arrays.stream(values()).filter((item) -> {
      return item.getType() == b;
    }).findFirst().orElse( null);
  }
}
